package cn.sciento.onelink.sim.communication.apn.info;

import cn.sciento.onelink.CommonResponse;
import cn.sciento.onelink.LinkRequest;
import cn.sciento.onelink.utils.ParamUtil;
import cn.sciento.onelink.utils.TransIdUtil;
import lombok.Builder;
import lombok.Data;

import java.util.HashMap;

/**
 * 单卡已开通 APN 信息查询
 * @author waltonlee
 */
@Data
@Builder
public class SimApnInfoRequest extends LinkRequest<CommonResponse<SimApnInfoResult>> {
    private String appId;
    private String token;
    private String msisdn;
    private String iccid;
    private String imsi;

    public SimApnInfoRequest(String appId, String token, String msisdn, String iccid, String imsi) {
        super(LinkRequest.Method.GET);
        this.appId = appId;
        this.token = token;
        this.msisdn = msisdn;
        this.iccid = iccid;
        this.imsi = imsi;
        this.path = "/ec/query/apn-info";
        HashMap<String, Object> heahMap = new HashMap<String, Object>();
        this.setHeader(heahMap);
        HashMap<String, Object> bodyMap = new HashMap<String, Object>();
        bodyMap.put("transid", TransIdUtil.generate(appId));
        bodyMap.put("token", token);
        bodyMap.putAll(ParamUtil.paramJudge(msisdn,iccid,imsi));
        this.setCompleteUrl(this.path,bodyMap);
    }
}
